package com.sa.screencomputer.utils;

import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;

import org.apache.log4j.Logger;

public class Constants {

	/** Logger */
	private static Logger logger = Logger.getLogger(Constants.class);

	/** FOLDER */
	public static final String FOLDER_TMP_IMAGES;

	/** COEF_IMAGE_1 */
	public static final float COEF_IMAGE_1;

	/** COEF_IMAGE_2 */
	public static final float COEF_IMAGE_2;

	static {
		logger.info("***** Initialisation des properties *****");
		ResourceBundle bundle = PropertyResourceBundle.getBundle("screencomputer");

		FOLDER_TMP_IMAGES = getString(bundle, "screencomputer.folder.tmp.image");
		COEF_IMAGE_1 = new Float(getString(bundle, "screencomputer.coef.image.1"));
		COEF_IMAGE_2 = new Float(getString(bundle, "screencomputer.coef.image.2"));

		logger.info("*****************************************");

	}

	/**
	 * @param bundle
	 * @param key
	 * @return
	 */
	public static String getString(ResourceBundle bundle, String key) {
		String value = bundle.getString(key);
		logger.info(" -> " + key + " : " + value);
		return value;
	}
}
